package dvonn.game;

import java.awt.Point;

public class Move {

	private Point from;
	private Point to;
	
	public Move( Point p1, Point p2) {
		this.from = p1;
		this.to = p2;
	}
	
	public Point getSource() {
		return this.from;
	}
	
	public Point getTarget() {
		return this.to;
	}
	
	public boolean equals(Move m) {
		if (!(this.from==m.getSource())) return false;
		if (!(this.to==m.getTarget())) return false;
		return true;
	}
	
	public String toString() {
		if (this!=null) return pPrint(this.from)+"->"+pPrint(this.to);
		return "pass";
	}
	
	public String pPrint(Point p) {
		return "(x="+p.x+",y="+p.y+")";
	}

}
